﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleWeb.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Sample</title>
    <link href="Content/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="Scripts/date.js" type="text/javascript"></script>
</head>
<body>
    <form id="frmDefault" runat="server">
    <h3>Employee</h3>
    <div>
        <p><strong>Employee Details</strong></p>    
        <table>
            <tbody>
                <tr>
                    <td></td>
                    <td>
                        <asp:HiddenField ID="EmployeeId" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>First Name</td>
                    <td>
                        <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Last Name</td>
                    <td>
                        <asp:TextBox ID="LastName" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Employee Type</td>
                    <td>
                        <asp:DropDownList ID="EmployeeType" runat="server">
                            <asp:ListItem Value="PER">Permanent</asp:ListItem>
                            <asp:ListItem Value="CON">Contract</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>Gender</td>
                    <td>
                        <asp:RadioButtonList ID="Gender" runat="server">
                            <asp:ListItem Value="M">Male</asp:ListItem>
                            <asp:ListItem Value="F">Female</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>Date of Birth</td>
                    <td>
                        <asp:TextBox ID="DateOfBirth" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>No. of Dependants</td>
                    <td>
                        <asp:TextBox ID="NoOfDependants" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequireNoOfDependants" runat="server" 
                            ControlToValidate="NoOfDependants" Display="Dynamic" 
                            ErrorMessage="No. of Dependants is required"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeNoOfDependants" runat="server" 
                            ControlToValidate="NoOfDependants" Display="Dynamic" 
                            ErrorMessage="Must be a number (0 - 50)" MaximumValue="50" MinimumValue="0" 
                            Type="Integer"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td>Is Active?</td>
                    <td>
                        <asp:CheckBox ID="IsActive" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>Skills<br />
                        (Multi-select)</td>
                    <td>
                        <asp:ListBox ID="Skills" runat="server" Rows="6" SelectionMode="Multiple">
                            <asp:ListItem Value="0">C#</asp:ListItem>
                            <asp:ListItem Value="1">Visual Basic</asp:ListItem>
                            <asp:ListItem Value="2">C++</asp:ListItem>
                            <asp:ListItem Value="3">Java</asp:ListItem>
                            <asp:ListItem Value="4">PHP</asp:ListItem>
                            <asp:ListItem Value="5">Python</asp:ListItem>
                        </asp:ListBox>
                    </td>
                </tr>
                <tr>
                    <td>Hobbies<br />
                        (Multi-select)</td>
                    <td>
                        <asp:CheckBoxList ID="Hobbies" runat="server">
                            <asp:ListItem Value="0">Sports</asp:ListItem>
                            <asp:ListItem Value="1">Video Games</asp:ListItem>
                            <asp:ListItem Value="2">Reading</asp:ListItem>
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td><b>Address</b></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>Street</td>
                    <td>
                        <asp:TextBox ID="Street" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>City</td>
                    <td>
                        <asp:TextBox ID="City" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>State or Province</td>
                    <td>
                        <asp:TextBox ID="StateOrProvince" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Country</td>
                    <td>
                        <asp:DropDownList ID="CountryCode" runat="server">
                            <asp:ListItem Value="US">USA</asp:ListItem>
                            <asp:ListItem Value="SG">Singapore</asp:ListItem>
                            <asp:ListItem Value="PH">Philippines</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>Postal Code</td>
                    <td>
                        <asp:TextBox ID="PostalCode" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                        <asp:Button ID="Submit" runat="server" onclick="SubmitClick" Text="Submit" />
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    
    <script type="text/javascript">

        $(document).ready(function() {            

            var dob = $("#DateOfBirth").datepicker();
            dob.datepicker("setDate", Date.parse($("#DateOfBirth").val()));

        });
    
    </script>
    
    </form>
</body>
</html>
